<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理系统</title>
    <!--<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">-->
    <link rel="stylesheet" href="css/http_cdn.jsdelivr.net_npm_bootstrap-icons@1.10.0_font_bootstrap-icons.css">
    <style>
        :root {
            --primary-color: #3498db;
            --secondary-color: #2c3e50;
            --accent-color: #e74c3c;
            --light-color: #ecf0f1;
            --dark-color: #34495e;
            --sidebar-width: 240px;
            --header-height: 60px;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background-color: #f5f7fa;
            color: #333;
            overflow-x: hidden;
			overflow-y: hidden;
        }
        
        /* 头部样式 */
        .header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: var(--header-height);
            background: linear-gradient(135deg, var(--secondary-color), var(--dark-color));
            color: white;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            z-index: 1000;
        }
        
        .logo {
            display: flex;
            align-items: center;
            font-size: 20px;
            font-weight: 600;
        }
        
        .logo i {
            margin-right: 10px;
            color: var(--primary-color);
        }
        
        .header-right {
            display: flex;
            align-items: center;
        }
        
        .user-profile {
            display: flex;
            align-items: center;
            cursor: pointer;
            position: relative;
        }
        
        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background-color: var(--primary-color);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 10px;
            overflow: hidden;
        }
        
        .user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .user-name {
            font-weight: 500;
            margin-right: 5px;
        }
        
        .notification-bell {
            position: relative;
            margin-right: 20px;
            font-size: 18px;
            cursor: pointer;
        }
        
        .notification-badge {
            position: absolute;
            top: -5px;
            right: -5px;
            background-color: var(--accent-color);
            color: white;
            border-radius: 50%;
            width: 16px;
            height: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
        }
        
        /* 左侧树形导航 */
        .sidebar {
            position: fixed;
            top: var(--header-height);
            left: 0;
            width: var(--sidebar-width);
            height: calc(100vh - var(--header-height));
            background-color: white;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
            z-index: 999;
            overflow-y: auto;
        }
        
        .sidebar-menu {
            padding: 15px 0;
        }
        
        .menu-title {
            padding: 10px 20px;
            font-size: 12px;
            color: #95a5a6;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        /* 树形菜单样式 */
        .tree-menu {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .tree-menu ul {
            list-style: none;
            padding-left: 20px;
            display: none;
        }
        
        .tree-menu li {
            position: relative;
        }
        
        .tree-menu li.active > ul {
            display: block;
        }
        
        .tree-menu a {
            display: flex;
            align-items: center;
            padding: 10px 20px;
            color: #7f8c8d;
            text-decoration: none;
            transition: all 0.2s;
            position: relative;
        }
        
        .tree-menu a:hover {
            background-color: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
        }
        
        .tree-menu a.active {
            background-color: rgba(52, 152, 219, 0.1);
            color: var(--primary-color);
            border-left: 3px solid var(--primary-color);
        }
        
        .tree-menu a i {
            margin-right: 10px;
            font-size: 16px;
        }
        
        .tree-menu .has-submenu > a:after {
            content: '\f285';
            font-family: 'bootstrap-icons';
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 12px;
            transition: transform 0.3s;
        }
        
        .tree-menu .has-submenu.active > a:after {
            transform: translateY(-50%) rotate(90deg);
        }
        
        /* 主内容区 */
        .main-content {
            margin-left: var(--sidebar-width);
            margin-top: var(--header-height);
            padding: 20px;
            min-height: calc(100vh - var(--header-height));
            transition: all 0.3s ease;
        }
        
        /* iframe样式 */
        .content-frame {
            width: 100%;
            height: calc(100vh - var(--header-height) - 40px);
            border: none;
            background: transparent;
        }
        
        /* 响应式设计 */
        @media (max-width: 992px) {
            .sidebar {
                transform: translateX(-100%);
            }
            
            .sidebar.show {
                transform: translateX(0);
            }
            
            .main-content {
                margin-left: 0;
            }
        }
    </style>
</head>
<body>
    <!-- 头部导航 -->
    <header class="header">
        <div class="logo">
            <i class="bi bi-shield-lock"></i>
            <span>管理系统</span>
        </div>
        <div class="header-right">
            <div class="notification-bell">
                <i class="bi bi-bell"></i>
                <span class="notification-badge">3</span>
            </div>
            <div class="user-profile">
                <div class="user-avatar">
                    <img src="https://randomuser.me/api/portraits/men/32.jpg" alt="用户头像">
                </div>
                <span class="user-name">张经理</span>
                <i class="bi bi-chevron-down"></i>
            </div>
        </div>
    </header>

    <!-- 左侧树形导航 -->
    <aside class="sidebar">
        <div class="sidebar-menu">
            <div class="menu-title">主导航</div>
            <ul class="tree-menu">
                <li>
                    <a href="dashboard.html" class="active" target="contentFrame">
                        <i class="bi bi-speedometer2"></i>
                        <span>控制台</span>
                    </a>
                </li>
                
                <li class="has-submenu">
                    <a href="#">
                        <i class="bi bi-box-seam"></i>
                        <span>产品管理</span>
                    </a>
                    <ul>
                        <li><a href="products.html" target="contentFrame">产品列表</a></li>
                        <li><a href="category.html" target="contentFrame">分类管理</a></li>
                        <li><a href="inventory.html" target="contentFrame">库存管理</a></li>
                    </ul>
                </li>
                
                <li class="has-submenu">
                    <a href="#">
                        <i class="bi bi-cart"></i>
                        <span>订单管理</span>
                    </a>
                    <ul>
                        <li><a href="orders.html" target="contentFrame">订单列表</a></li>
                        <li><a href="returnExchangeList.html" target="contentFrame">退换货</a></li>
                    </ul>
                </li>
                
                <li class="has-submenu">
                    <a href="#">
                        <i class="bi bi-graph-up"></i>
                        <span>数据分析</span>
                    </a>
                    <ul>
                        <li><a href="sales-analysis.html" target="contentFrame">销售分析</a></li>
                        <li><a href="users-analysis.html" target="contentFrame">用户分析</a></li>
                    </ul>
                </li>
                <li class="has-submenu">
                    <a href="#">
                        <i class="bi bi-people"></i>
                        <span>用户管理</span>
                    </a>
                    <ul>
                        <li><a href="users.html" target="contentFrame">用户列表</a></li>
                        <li><a href="role.html" target="contentFrame">角色管理</a></li>
                        <li><a href="permission.html" target="contentFrame">权限设置</a></li>
                    </ul>
                </li>
                
                <div class="menu-title">系统设置</div>
                
                <li>
                    <a href="system.html" target="contentFrame">
                        <i class="bi bi-gear"></i>
                        <span>系统设置</span>
                    </a>
                </li>
                
                <li>
                    <a href="personal.html" target="contentFrame">
                        <i class="bi bi-person-circle"></i>
                        <span>个人中心</span>
                    </a>
                </li>
            </ul>
        </div>
    </aside>

    <!-- 主内容区 - 使用iframe加载不同页面 -->
    <main class="main-content">
        <iframe src="dashboard.html" name="contentFrame" class="content-frame"></iframe>
    </main>

    <script>
        // 树形菜单切换功能
        document.querySelectorAll('.tree-menu .has-submenu > a').forEach(item => {
            item.addEventListener('click', function(e) {
                if(this.getAttribute('href') === '#') {
                    e.preventDefault();
                    const parentLi = this.parentElement;
                    
                    // 关闭其他已打开的菜单
                    document.querySelectorAll('.tree-menu .has-submenu.active').forEach(activeItem => {
                        if (activeItem !== parentLi) {
                            activeItem.classList.remove('active');
                        }
                    });
                    
                    // 切换当前菜单状态
                    parentLi.classList.toggle('active');
                }
            });
        });
        
        // 点击菜单项时设置active状态
        document.querySelectorAll('.tree-menu a').forEach(item => {
            item.addEventListener('click', function() {
                // 移除所有active状态
                document.querySelectorAll('.tree-menu a').forEach(link => {
                    link.classList.remove('active');
                });
                
                // 为当前点击项添加active状态
                this.classList.add('active');
                
                // 如果是子菜单项，也激活父菜单
                if(this.parentElement.parentElement.classList.contains('tree-menu')) {
                    const parentMenu = this.closest('.has-submenu');
                    if(parentMenu) {
                        parentMenu.classList.add('active');
                        parentMenu.querySelector('> a').classList.add('active');
                    }
                }
            });
        });
    </script>
</body>
</html>